CFILE  =      sbalance.c \
		sbalgorithm.c \
		sbconf.c     \
		sbrbtree.c   \
		sbproxy.c \
		sbtimer.c \
		sbdns.c \
		sbutil.c \
		sbmain.c

HFILE  = sbalance.h \
		sbrbtree.h
IFLAGS =  -I. -I/home/idd/hotmocha/exlib/include 
CC = gcc -g
.SUFFIXES:.c
.c.o    :
	$(CC) $(CFLAGS) -c $< $(IFLAGS)

c_FILE_o = $(CFILE:.c=.o)

all: $(c_FILE_o) sbalance.h sbrbtree.h sbproxy.h sblist.h sbutil.h  sbatomic.h
	gcc -o hotmocha $(c_FILE_o) -lcares -L. -L/home/idd/hotmocha/exlib/lib/ -I. -I/home/idd/hotmocha/exlib/include/ 

rbtree: sbrbtree.c sbrbtree.h test_rbtree.c
	gcc -o rbtree sbrbtree.c test_rbtree.c -g
rb:
	gcc -o rb sbrbtree.c rb.c -g

DNS_CFILE = $(CFILE) \
		testdns.c 

c_dns_FILE_o = $(DNS_CFILE:.c=.o)

testdns:  $(c_dns_FILE_o) sbalance.h sbparsehost.h testdns.c
	gcc -g -o testdns $(c_dns_FILE_o) -lcares -L. -L/home/idd/hotmocha/exlib/lib/

clean:
	rm -rf *.o sb rbtree testdns
